package com.nineclock.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nineclock.model.pojo.SysCompanyUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SysCompanyUserMapper extends BaseMapper<SysCompanyUser> {

    @Select("SELECT scu.* from sys_role sr ,sys_company_user_role scur,sys_company_user scu " +
            "WHERE sr.role_name='ROLE_ADMIN_SYS' and scu.company_id=#{companyId} and sr.id = scur.role_id and scur.company_user_id=scu.id ")
    public SysCompanyUser queryMainAdminCompanyUser(@Param("companyId") Long companyId);
}
